/*Copyright (c) 2020 XXX
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */
#ifndef SWANLINK_FINANCE_CARDSENDER_ADAPTOR_F5G006_INCLUDE_CARDSENDER_F5G006_H
#define SWANLINK_FINANCE_CARDSENDER_ADAPTOR_F5G006_INCLUDE_CARDSENDER_F5G006_H
#include <securec.h>
#include "icardsender_adaptor.h"
#include "cardsender_def.h"
#include "hilog_wrapper.h"
#include "f5g006_api.h"

namespace SwanLink {
namespace Finance {
class ICardSenderF5g006Adaptor: public ICardSenderAdaptor {
 public:
    ICardSenderF5g006Adaptor();
    ~ICardSenderF5g006Adaptor();
    bool IsOpen() override;
    int Open(const Transport& transport) override;
    int Close() override;
    int Reset() override;
    int GetStatus(unsigned char pSuppBinStat[], unsigned char pRetainBinStat[]) override;
    int GetStatus(char* err) override;  // 发卡机不使用该函数
    int GetStatus();  //  用于再执行控制函数前判断发卡机是否正常
    int DispenseCard() override;
    int TransformResultCode(int code);
 private:
    bool isOpen;
    F5G006_HANDLE handle;
};
}  // namespace Finance
}  // namespace SwanLink
#endif  // SWANLINK_FINANCE_CARDSENDER_ADAPTOR_F5G006_INCLUDE_CARDSENDER_F5G006_H
